package com.dtp.core.context;

import com.dtp.core.support.ExecutorWrapper;
import com.dtp.common.entity.NotifyItem;
import com.dtp.common.em.NotifyItemEnum;
import lombok.Data;

/**
 * 基本通知上下文
 *
 * @author yanhom
 * @since 1.0.8
 *
 * @remark muse
 */
@Data
public class BaseNotifyCtx {

    private ExecutorWrapper executorWrapper;    // 执行器包装类
    private NotifyItem notifyItem;              // 通知项信息

    public BaseNotifyCtx() {}

    public BaseNotifyCtx(ExecutorWrapper wrapper, NotifyItem notifyItem) {
        this.executorWrapper = wrapper;
        this.notifyItem = notifyItem;
    }

    /** 通过type获得通知项目枚举类 */
    public NotifyItemEnum getNotifyItemEnum() {return NotifyItemEnum.of(notifyItem.getType());}
}
